package com.atguigu.responsibilitychain;

import java.math.BigDecimal;

public class CollegeOperator extends Operator {
    public CollegeOperator(String name) {
        super(name);
    }

    @Override
    public void processRequest(PurchaseRequest purchaseRequest) {
        int result = purchaseRequest.getPrice().compareTo(new BigDecimal("10000"));
        if (result <= 0) {
            System.out.println("请求编号id\t" + purchaseRequest.getId() + "\t被\t" + this.name + "\t处理");
        } else {
            operator.processRequest(purchaseRequest);
        }
    }
}
